<template>
  <div class="LiquidMedicineSecond">
    <div class="time-pick">
      <span>选择月份 </span>
      <el-date-picker
        v-model="month"
        type="month"
        placeholder="选择月份"
      />
    </div>
    <div class="main-content">
      <div class="box-wrap">
        <div class="title">药水浓度超标次数</div>
        <div class="chart-wrap">
          <count-line id="count-line1" height="100%" width="100%" />
        </div>
      </div>
      <div class="box-wrap">
        <div class="title">非单点超标次数</div>
        <div class="chart-wrap">
          <count-line id="count-line2" height="100%" width="100%" />
        </div>
      </div>
      <div class="box-wrap">
        <div class="title">各药水浓度超标次数</div>
        <div class="chart-wrap">
          <count-bar id="count-bar" height="100%" width="100%" />
        </div>
      </div>
      <div class="box-wrap">
        <div class="title">超标药水占比</div>
        <div class="chart-wrap chart-pie">
          <div>
            <pie id="potion-pie1" height="100%" width="100%" ctitle="A线" />
          </div>
          <div>
            <pie id="potion-pie2" height="100%" width="100%" ctitle="B线" />
          </div>
        </div>
      </div>
      <div class="box-wrap">
        <div class="title">当天各药水浓度</div>
        <div class="chart-wrap potion-lines">
          <div>
            <potion-line id="potion-line1" height="100%" width="100%" ctitle="碳酸钠" />
          </div>
          <div>
            <potion-line id="potion-line2" height="100%" width="100%" ctitle="CU+" />
          </div>
          <div>
            <potion-line id="potion-line3" height="100%" width="100%" ctitle="氢氧化钠" />
          </div>
          <div>
            <potion-line id="potion-line4" height="100%" width="100%" ctitle="氯离子" />
          </div>
        </div>
      </div>
    </div>
  </div>
</template>

<script>
import CountLine from './charts/liquid/CountLine'
import CountBar from './charts/liquid/CountBar'
import Pie from './charts/liquid/Pie'
import PotionLine from './charts/liquid/PotionLine'

export default {
  name: 'LiquidMedicineSecond',
  components: { CountLine, CountBar, Pie, PotionLine },
  data() {
    return {
      month: '2021-08'
    }
  },
  methods: {}
}
</script>

<style lang="scss">
.LiquidMedicineSecond{
    width: 100%;
    height: 100%;

    .main-content{
      display: flex;
      flex-wrap: wrap;
      flex-direction: column;
      width: 100%;
      height: calc(100% - 46px);

      .box-wrap{
        width: calc(100% / 3);
        height: 50%;

        &:last-child{
          flex: auto;
        }

        &:first-child, &:nth-child(3){
          border-bottom: 1px solid #5967a4;
        }
        &:nth-child(3), &:nth-child(4){
          border-left: 1px solid #5967a4;
        }
        &:last-child {
          border-left: 1px solid #5967a4;
        }
      }

      .title{
          margin-left: 20px;
          margin-top: 10px;
          color: #bebebe;
        }

      .chart-wrap{
        height: calc(100% - 30px);

        &.chart-pie{
          display: flex;
          overflow-x: auto;
          > div{
            width: 50%;
            height: 100%;
          }
        }

        &.potion-lines{
          display: flex;
          flex-direction: column;

          > div {
            width: 100%;
            height: calc(100% / 4);
          }
        }
      }
    }
}
</style>
